#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

class Student
{
public:  
    Student(int num = 0)
        :_num(num)
        , _score(0)
    {}
    void SetScore(float s) { _score = s; _max = max(_max, s); }
    int GetNum() const { return _num; }
    float GetScore() const { return _score; }
    static float _max;
private:
    int _num;  //学号
    float _score; //分数
};
float Student::_max = 0;

void max(Student arr[], int n) 
{
    for (int i = 0; i < n; i++)
        if (arr[i].GetScore() == Student::_max)
            cout << arr[i].GetNum() << ' ' << Student::_max << endl;
}

int main()
{
    int i, n, num;
    float score;
    cin >> n;
    Student* stu = new Student[n];
    for (i = 0; i < n; i++)
    {
        cin >> num >> score;
        stu[i] = Student(num);
        stu[i].SetScore(score);
    }
    max(stu, n);
    delete[] stu;
    return 0;
}

